package com.lin.musicplayer.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * Created by crystal on 2016/7/7.
 */
public class MusicDB extends SQLiteOpenHelper{
    String sql;
    String name;
    public  void setName(String name)
    {
        this.name=name;
    }
    public MusicDB(Context context)
    {
        super(context,"Music",null,1);
    }
    @Override
    public void onCreate(SQLiteDatabase sqLiteDatabase) {
        sql="create table "+name+"(name varchar(20)primary key)";
        sqLiteDatabase.execSQL(sql);
       // System.out.println("                                                 success!\n\n\n");
    }

    @Override
    public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {
        //  sqLiteDatabase.execSQL("drop table if exits lovemusic");
        //  onCreate(sqLiteDatabase);
    }
}
